<template>
    <li class="submus">
        <div class="title" @click="toggleChange">
            <slot name="title"></slot>
        </div>
        <div v-show="flag" class="subchild">
            <slot></slot>
        </div>
    </li>
</template>
<script>
export default {
    data(){
        return{
            flag:true
        }
    },
    methods:{
        toggleChange(){
            this.flag = !this.flag;
        }
    }
}
</script>
<style lang="less" scoped>
.submus{
    width:200px;
    .title{
        display: flex;
        align-items: center;
        height:50px;
    }
    .subchild{
        padding-left: 15px;
    }
}
</style>